package com.ruoyi.project.jiaqin.downstandard.service.impl;

import java.util.List;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.jiaqin.downstandard.mapper.DownStandardMapper;
import com.ruoyi.project.jiaqin.downstandard.domain.DownStandard;
import com.ruoyi.project.jiaqin.downstandard.service.IDownStandardService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 羽绒标准分类Service业务层处理
 *
 * @author admin
 * @date 2021-01-29
 */
@Service
public class DownStandardServiceImpl implements IDownStandardService
{
    @Autowired
    private DownStandardMapper downStandardMapper;

    /**
     * 查询羽绒标准分类
     *
     * @param id 羽绒标准分类ID
     * @return 羽绒标准分类
     */
    @Override
    public DownStandard selectDownStandardById(String id)
    {
        return downStandardMapper.selectDownStandardById(id);
    }

    /**
     * 查询羽绒标准分类列表
     *
     * @param downStandard 羽绒标准分类
     * @return 羽绒标准分类
     */
    @Override
    public List<DownStandard> selectDownStandardList(DownStandard downStandard)
    {
        return downStandardMapper.selectDownStandardList(downStandard);
    }

    /**
     * 新增羽绒标准分类
     *
     * @param downStandard 羽绒标准分类
     * @return 结果
     */
    @Override
    public int insertDownStandard(DownStandard downStandard)
    {
        downStandard.setId(UUID.randomUUID().toString().replace("-",""));
        return downStandardMapper.insertDownStandard(downStandard);
    }

    /**
     * 修改羽绒标准分类
     *
     * @param downStandard 羽绒标准分类
     * @return 结果
     */
    @Override
    public int updateDownStandard(DownStandard downStandard)
    {
        return downStandardMapper.updateDownStandard(downStandard);
    }

    /**
     * 删除羽绒标准分类对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteDownStandardByIds(String ids)
    {
        return downStandardMapper.deleteDownStandardByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除羽绒标准分类信息
     *
     * @param id 羽绒标准分类ID
     * @return 结果
     */
    @Override
    public int deleteDownStandardById(String id)
    {
        return downStandardMapper.deleteDownStandardById(id);
    }
}
